import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    token: 'ceshi123456'
  },
  mutations: {
    // 登录
    loginSuccess(state, token) {
      state.token = token;
      localStorage.setItem("token", token);
    },
    // 退出
    logout(state, token) {
      state.token = token;
      localStorage.setItem("token", "");
    }
  },
  actions: {},
  modules: {}
});
